package com.amcase.demk.service.impl;

import com.amcase.demk.mapper.UserMapper;
import com.amcase.demk.model.User;
import com.amcase.demk.service.IUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName:UserService
 * @Decription:TODO
 * @Author:amcase
 * @Data:2018/4/11 11:16
 * @Version:1.0
 **/
@Service
public class UserService implements IUserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public User findById(String id) {
        User user = new User();
        if(StringUtils.isNoneBlank(id)){
            user = userMapper.selectByPrimaryKey(Long.parseLong(id));
        }
        return user;
    }
}
